%   computes the value of the forecaster's loss function

%   conditional on 
%       alpha (the preference parameters
%       p (the shape parameter)
%       x (the data)
%       x_hat (the forecast)
%   this function returns the loss

function [L] = mvloss(A,x,xm1,alfa,p)



t = 2 * alfa - 1;
e = x - A * xm1;
L = 0;
for i = 1:size(x,2);
    ell = 0.5 * (norm(e(:,i),p) + t' * e(:,i)) * norm(e(:,i),p)^(p-1);
    L = L + ell;
end